package com.itheima.homework.work4;

import java.util.Scanner;

/*
键盘录入一个字符串，统计该字符串中大写字母字符，小写字母字符，数字字符出现的次数(不考虑其他字符)
 */
public class Demo4 {
    public static void main(String[] args) {
        Scanner sc=new Scanner(System.in);
        System.out.println("请输入一个字符串：");
        String str = sc.nextLine();
        int da=0;
        int xiao=0;
        int num=0;
        char[] chars = str.toCharArray();
        for (int i = 0; i < chars.length; i++) {
            if (chars[i]<='z'&&chars[i]>='a'){
                xiao++;
            }else if (chars[i]<='Z'&&chars[i]>='A'){
                da++;
            }else if (chars[i]<='9'&&chars[i]>='0'){
                num++;
            }
        }
        System.out.println("大写字母有："+da+"个");
        System.out.println("小写字母有："+xiao+"个");
        System.out.println("数字字母有："+num+"个");
    }
}
